﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Infragistics.WebUI.UltraWebListbar;

public partial class index_jjjs : PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (_Customer.Competences.IsOwnedCompetences(Competences.Administrator) || _Customer.CustomerTypeID == 0)
        {
            SiteParentItem();   //总商城菜单
        }
        else
        {
            SiteChildItem();    //子商城菜单，已激活会员的菜单
        }
    }

    #region Web 窗体设计器生成的代码

    protected override void OnLoad(EventArgs e)
    {
        isRequestLogin = true;                                  //是否需要登录
        RequestLoginPage = this.Request.Url.AbsoluteUri;        //获取决对Url
        isAtFramePageLogin = true;                              //是框架页

        //RequestCompetences = Competences.BuildCompetencesList(Competences.BDGL_2);//页面权限

        base.OnLoad(e);
    }

    #endregion

    private void SiteParentItem()
    {
        lbModelName.Text = "奖金结算"; //模块名称

        lbMain.Groups.Clear();

        Group group_xtgg = new Group("系统公告", "g_xtgg");
        setGroupStyle(group_xtgg);
        lbMain.Groups.Add(group_xtgg);
        Items items_xtgg = lbMain.Groups.FromKey("g_xtgg").Items;
        items_xtgg.Clear();

        items_xtgg.Add(new Item("信息管理", "./images/clearing/9_dian.jpg", "BalanceCenter/AdminInformation.aspx"));
        items_xtgg.Add(new Item("培训信息", "./images/clearing/9_dian.jpg", "BalanceCenter/Information.aspx?ID=1"));
        items_xtgg.Add(new Item("新闻信息", "./images/clearing/9_dian.jpg", "BalanceCenter/Information.aspx?ID=2"));
        items_xtgg.Add(new Item("活动信息", "./images/clearing/9_dian.jpg", "BalanceCenter/Information.aspx?ID=3"));

        Group group_xtxy = new Group("合作协议", "g_xtxy");
        setGroupStyle(group_xtxy);
        lbMain.Groups.Add(group_xtxy);
        Items items_xtxy = lbMain.Groups.FromKey("g_xtxy").Items;
        items_xtxy.Clear();

        items_xtxy.Add(new Item("市场计划", "./images/clearing/9_dian.jpg", "BalanceCenter/AdminEditWin.aspx"));
        items_xtxy.Add(new Item("注册协议", "./images/clearing/9_dian.jpg", "BalanceCenter/RegisterRule.aspx"));
        items_xtxy.Add(new Item("服务中心公告", "./images/clearing/9_dian.jpg", "BalanceCenter/SurrogateRule.aspx"));

        Group group_xxjl = new Group("信息交流", "g_xxjl");
        setGroupStyle(group_xxjl);
        lbMain.Groups.Add(group_xxjl);
        Items items_xxjl = lbMain.Groups.FromKey("g_xxjl").Items;
        items_xxjl.Clear();

        items_xxjl.Add(new Item("在线资询", "./images/clearing/9_dian.jpg", "BalanceCenter/MyMessageBoardList.aspx"));
        items_xxjl.Add(new Item("回复留言", "./images/clearing/9_dian.jpg", "BalanceCenter/AdminMessageBoard.aspx"));
        //items_xxjl.Add(new Item("群发邮件", "./images/clearing/9_dian.jpg", "BalanceCenter/AdminSendEmail.aspx"));
        items_xxjl.Add(new Item("群发短息", "./images/clearing/9_dian.jpg", "BalanceCenter/AdminSendSMS.aspx"));
        
        //items_xxjl.Add(new Item("汇款通知管理", "./images/clearing/9_dian.jpg", "BalanceCenter/MyMessageBoardListCopy.aspx"));

        Group group_hygl = new Group("会员管理", "g_hygl");
        setGroupStyle(group_hygl);
        lbMain.Groups.Add(group_hygl);
        Items items_hygl = lbMain.Groups.FromKey("g_hygl").Items;
        items_hygl.Clear();

        items_hygl.Add(new Item("新会员注册报单", "./images/clearing/9_dian.jpg", "BalanceCenter/Buy.aspx"));
        items_hygl.Add(new Item("会员列表", "./images/clearing/9_dian.jpg", "BalanceCenter/AdminUserList.aspx"));
        items_hygl.Add(new Item("销售业绩查询一", "./images/clearing/9_dian.jpg", "BalanceCenter/Net.aspx"));
        items_hygl.Add(new Item("销售业绩查询二", "./images/clearing/9_dian.jpg", "BalanceCenter/Net2.aspx"));
        items_hygl.Add(new Item("我的团队", "./images/clearing/9_dian.jpg", "BalanceCenter/CommendList.aspx"));
        items_hygl.Add(new Item("会员转帐", "./images/clearing/9_dian.jpg", "BalanceCenter/EarningToVirtual.aspx"));

        items_hygl.Add(new Item("我的业绩", "./images/clearing/9_dian.jpg", "BalanceCenter/ScoreEarning.aspx"));
        items_hygl.Add(new Item("我的电子货币", "./images/clearing/9_dian.jpg", "BalanceCenter/ScoreEarning2.aspx"));
        //items_hygl.Add(new Item("我的返还货币", "./images/clearing/9_dian.jpg", "BalanceCenter/ScoreEarning3.aspx"));                        
        items_hygl.Add(new Item("各帐户汇总", "./images/clearing/9_dian.jpg", "BalanceCenter/VirtualMoneyList.aspx"));


        Group group_dlzx = new Group("代理中心", "g_dlzx");
        setGroupStyle(group_dlzx);
        lbMain.Groups.Add(group_dlzx);
        Items items_dlzx = lbMain.Groups.FromKey("g_dlzx").Items;
        items_dlzx.Clear();

        items_dlzx.Add(new Item("待激活会员", "./images/clearing/9_dian.jpg", "BalanceCenter/ActivationUserList.aspx"));
        items_dlzx.Add(new Item("已激活会员", "./images/clearing/9_dian.jpg", "BalanceCenter/ActivationList.aspx"));        


        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();
        group_g.Enabled = false;
    }

    private void SiteChildItem()
    {
        lbModelName.Text = "公司资讯"; //模块名称

        lbMain.Groups.Clear();

        Group group_xtgg = new Group("公司资讯", "g_xtgg");
        setGroupStyle(group_xtgg);
        lbMain.Groups.Add(group_xtgg);
        Items items_xtgg = lbMain.Groups.FromKey("g_xtgg").Items;
        items_xtgg.Clear();

        items_xtgg.Add(new Item("公司新闻", "./images/clearing/9_dian.jpg", "BalanceCenter/Information.aspx?ID=2"));
        items_xtgg.Add(new Item("活动信息", "./images/clearing/9_dian.jpg", "BalanceCenter/Information.aspx?ID=3"));
        items_xtgg.Add(new Item("销售排行榜", "./images/clearing/9_dian.jpg", "BalanceCenter/BalanceCenterIndex.aspx"));
        items_xtgg.Add(new Item("产品PV值查询", "./images/clearing/9_dian.jpg", "shop/GoodPV_Search.aspx"));    


        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();
        group_g.Enabled = false;
    }

    private void setGroupStyle(Group group)
    {
        group.Expanded = false;
        group.TextAlign = "left";
        group.ItemAlign = "left";
        group.ImageTextAlign = ImageTextAlign.Middle;
    }
}
